﻿using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Logging.Factory;
using Logging;
using Logging.Utils;

namespace LoggingTest
{
    /// <summary>
    /// Description résumée pour UnitTestBDD
    /// </summary>
    [TestClass]
    public class UnitTestBDD
    {
        [TestInitialize]
        public void TestInit()
        {
            LoggingFactory.Dispose();
        }

        [TestMethod]
        public void TestMethodLogServiceBDD()
        {
            ILogService log = LoggingFactory.GetLogService(new ParamLog() { TypeLog = TypeLog.BDD, NameOrConnectionString = "COUCOU" });
            Assert.IsNotNull(log);
        }

        [TestMethod]
        public void TestMethodLogBDD()
        {
            ILogService log = LoggingFactory.GetLogService(new ParamLog() { TypeLog = TypeLog.BDD, NameOrConnectionString = "COUCOU" });

            LogTrace trace = new LogTrace
            {
                UtilisateurConnecte = "legouellecs",
                Niveau = LogLevel.Fatal,
                Identifiant = "legouellecs",
                Ecran = "LivraisonATF",
                DetailMessage = "TEST"
            };

            log.WriteLog(trace);
        }
    }
}
